//
//  hzy.h
//  wanhucang
//
//  Created by 郝志宇 on 16/1/26.
//  Copyright © 2016年 XuDong Jin. All rights reserved.
//

#ifndef hzy_h
#define hzy_h

#ifndef __OPTIMIZE__
    #define NSLog(...) NSLog(__VA_ARGS__)
#else
    #define NSLog(...)
#endif

#import <UIKit/UIKit.h>
#import "AFNetworking.h"
#import "Tool.h"
#import "MJRefresh.h"
#import "JPUSHService.h"
#import "TPKeyboardAvoidingScrollView.h"
#import "IGRootTabBarViewController.h"
#import "BaseNavigationController.h"
#import <Foundation/Foundation.h>
#import "MJExtension.h"
#import "IGServerConfig.h"
#import "YTKNetwork.h"
#import "IGUser.h"
#import "JSONModelLib.h"
#import <Masonry.h>
#import "IGPermissionUtil.h"
#import "IGTakePhotosUtil.h"
#import "YYText.h"
#import "ChatKeyBoardMacroDefine.h"
#import "IGCategorys.h"
#import "UMMobClick/MobClick.h"
#import "IGBatchRequest.h"
#import "IGCEnum.h"
#import "IGArtWorkModel.h"
#import "IGDrawModel.h"

#define kAvatar_Size 40
#define kGAP24 24
#define kGAP20 20
#define kGAP18 18
#define kGAP17 17
#define kGAP15 15
#define kGAP14 14
#define kGAP11 11
#define kGAP10 10
#define kGAP6 6

#define kAPPDELEGATE    (AppDelegate *)[UIApplication sharedApplication].delegate
#define kKeyWindow      [UIApplication sharedApplication].delegate.window
#define KSCREENWIDTH    ([UIScreen mainScreen].bounds.size.width)
#define KSCREENHEIGHT   ([UIScreen mainScreen].bounds.size.height)

#define KWeakObj(o)     autoreleasepool{} __weak typeof(o) o##Weak = o;
#define KStrongObj(o)   autoreleasepool{} __strong typeof(o) o = o##Weak;

#define RGB(R,G,B)      [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:1.0f]


/***********屏幕适配*************/
#define iphoneX         (KSCREENHEIGHT == 812)
#define iphone6P        (KSCREENHEIGHT == 736)
#define iphone6         (KSCREENHEIGHT == 667)
#define iphone5         (KSCREENHEIGHT == 568)
#define iphone4         (KSCREENHEIGHT == 480)
/***********屏幕适配*************/

/***********IPHONEX适配*************/
#define NavigationMagin (iphoneX ? 88 : 64)
#define SafeTopMagin (iphoneX ? 44 : 20)
#define SafeBottomMagin (iphoneX ? 34 : 0)

#define AdjustsScrollViewInsetNever(controller, view) if(@available(iOS 11.0, *)) { \
                                                        view.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;\
                                                    } else if([controller isKindOfClass:[UIViewController class]]) {\
                                                        controller.automaticallyAdjustsScrollViewInsets = NO;\
                                                    }

#define KSCALE(value)  (value * KSCREENWIDTH/1242)
#define GSCALE(value)  (value * KSCREENWIDTH/375)
#define BANNERHEIGHT   (KSCREENWIDTH * 28 / 75)
#define INTROHEIGHT    (iphoneX ? KSCALE(580) : KSCALE(520))
#define UPDATASUCC     @"UPDATASUCC"
#define KVideoFullScreenNotification @"KVideoFullScreenNotification"

#define KViewWeight self.bounds.size.width
#define KViewHeight self.bounds.size.height

// 友盟  key （完成）
#define UmengAppkey @"57c5686867e58e79d1002cb8"
// QQ 互联 （QQ登陆） （完成）
#define tencentAppid  @"1105635202"
#define tencentConnectAppkey @"N5uMJmoPN22bmMQy"
// 微信 key
#define weiXinAppId @"wx85db2bdef353907a"
#define weiXinAppSecret @"ecdc6d398f6b4a8f063d55df0b4ff7f8"
// 微信 新账号--key
//#define weiXinAppId @"wx6669b69da81b425e"
//#define weiXinAppSecret @"3a0d2c37fb5d8b3242ecf5c68123079c"

// 新浪微博
#define sinaAppKey @"1309585351"
#define sinaAppSecret @"6d040446526137759fc4ee9d4ce750a4"
#define kRedirectURI @"http://sns.whalecloud.com/sina2/callback"
// APPID
#define STOREAPPID @"1150322560"
//极光推送的key
#define JPUSH_APP_KEY @"0d137a96526fbde25b79c78a"
//应用注册scheme,在xxx-Info.plist定义 1> URL types --- 2>  URL Schemes
#define schemeUrl @"jingdongfang2017"
//
#define  KLanguage  @"currentLanguage"

typedef void(^NoParaNoReturnBlock)(void);

#ifdef DEBUG
#define NSLogDebug(s, ...) NSLog(@"%s [ line--%d ]: %@", __FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
#define NSLogDebug(s, ...)
#endif

#endif /* hzy_h */
